home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
graphics
/
zoom.zoo
/
zoomline.s
< prev
Wrap
Text File
|
1991-04-07
|
3KB
|
141 lines
*
* Zoom 16 screen lines up by 8 times
*
csect program
xdef @zoomLine
*
* Zoom a 16x16 square of pixels by 8
*
* void
* zoomLine(void *screen, void *zoomed, short lineBytes, short offset)
*
* screen : (word) address of top line in screen to be zoomed
* zoomed : address of array uchar[128][16]
* lineBytes : bytes per screen line (found from line A structure)
* offset : bit offset of required word in a screen longword
*
* Lattice requires that functions preserve d2-d7/a2-6
*
@zoomLine
movem.l d2-d4/a2,-(sp)
swap.w d0
clr.w d0
swap.w d0
move.l #$fefefefe,d2
move.w #15,d3
oneline:
move.l (a0),d4 Get 32 pixels
rol.l d1,d4 Rotate to get correct pixels in top word
swap.w d4 Pixels now in low word of d4
adda.l d0,a0 Point to next screen line down
movea.l a1,a2 Save in a2, preparing for copy
* a0 = next screen line
* a1 = 0'th line of zoomed blocks
* a2 = 0'th line of zoomed blocks
* d0 = bytes per screen line
* d1 = shift for screen pixels
* d2 = bit mask to get the Mac-style zoomed blocks
* d3 = line count
* d4 = (word) pixels
* 16 rotates and scs's produce a zoomed line in (a2)
rol.w #1,d4
scs.b (a1)+
rol.w #1,d4
scs.b (a1)+
rol.w #1,d4
scs.b (a1)+
rol.w #1,d4
scs.b (a1)+
rol.w #1,d4
scs.b (a1)+
rol.w #1,d4
scs.b (a1)+
rol.w #1,d4
scs.b (a1)+
rol.w #1,d4
scs.b (a1)+
rol.w #1,d4
scs.b (a1)+
rol.w #1,d4
scs.b (a1)+
rol.w #1,d4
scs.b (a1)+
rol.w #1,d4
scs.b (a1)+
rol.w #1,d4
scs.b (a1)+
rol.w #1,d4
scs.b (a1)+
rol.w #1,d4
scs.b (a1)+
rol.w #1,d4
scs.b (a1)+
and.l d2,(a2)+ Clear right-most bit in each byte
and.l d2,(a2)+
and.l d2,(a2)+
and.l d2,(a2)
lea -12(a2),a2 Correct
* Copy line 0 to line 1
move.l (a2)+,(a1)+
move.l (a2)+,(a1)+
move.l (a2)+,(a1)+
move.l (a2)+,(a1)+ Line 1
* Line 1 to line 2
move.l (a2)+,(a1)+
move.l (a2)+,(a1)+
move.l (a2)+,(a1)+
move.l (a2)+,(a1)+ Line 2
* Line 2 to line 3
move.l (a2)+,(a1)+
move.l (a2)+,(a1)+
move.l (a2)+,(a1)+
move.l (a2)+,(a1)+ Line 3
* Line 3 to line 4
move.l (a2)+,(a1)+
move.l (a2)+,(a1)+
move.l (a2)+,(a1)+
move.l (a2)+,(a1)+ Line 4
* Line 4 to line 5
move.l (a2)+,(a1)+
move.l (a2)+,(a1)+
move.l (a2)+,(a1)+
move.l (a2)+,(a1)+ Line 5
* Line 5 to line 6
move.l (a2)+,(a1)+
move.l (a2)+,(a1)+
move.l (a2)+,(a1)+
move.l (a2),(a1)+ Line 6
* Clear line 7
clr.l (a1)+
clr.l (a1)+
clr.l (a1)+
clr.l (a1)+ Line 7
* a0 = address of next screen word to be zoomed
* a1 = address of first long in next zoom line
* a2 = address of last long in line 6
* d0 = bytes per screen line
* d2 = 0xfefefefe
* d3 = line count
* d4 = screen word
dbra d3,oneline
movem.l (sp)+,d2-d4/a2
rts
end
* End of zoomline.s